<?php
$version = Zend_Registry::get('version');
$this->headTitle()->headTitle($this->translator->translator('Member_group_page_name'),'SET');
?>
<script type="text/javascript">
$(document).ready(function() 
{	
	function openMsgDialog(msg)
	{
		$('#dialog_msg').html(msg).dialog({
			autoOpen: true,
			modal: true,
			show: 'fade',
			resizable: 'false',				
			buttons: { "<?php echo html_entity_decode($this->translator->translator('common_ok'), ENT_QUOTES, 'UTF-8'); ?>": function() { $(this).dialog('option', 'hide', 'explode').dialog("close"); } },
			open: function(event, ui)
				 {
					setTimeout(function() 
					{									
						if($('#' + event.target.id).dialog('isOpen'))
						{
							$('#' + event.target.id).dialog('option', 'hide', 'explode').dialog('close');										
						}
					}, 5000);
				  }
		});
	}
	
	$('a.add_user_btn').click(function() {
		var role_id = '';			
		$.each($('#GroupForm').serializeArray(), function(i, field) {			
			role_id = (field.name == 'role_id') ? field.value : '';			
		});					
		if(role_id == '')
		{
			openMsgDialog("<?php echo $this->translator->translator('Member_group_page_select_err'); ?>");
		}
		else
		{
			var links = "<?php echo $this->serverUrl().$this->url(array('module' => 'Members','controller'=>'frontend', 'action'=>'register',  role_id => ''),'Registration/:role_id',true);?>";
			$(this).attr('href',links+'/'+role_id);
			document.location.href=links+role_id;
		}
	});
	
});
</script>

<div class="mod mod-reg">
	<div class="users-icon">
        <h1><?php echo $this->translator->translator('Member_group_page_name'); ?></h1>
    </div>

	<div class="clear">&nbsp;</div>
<div class="forbidden-message"><?php echo $this->translator->translator('membership_info'); ?></div>

    <form name="GroupForm" id="GroupForm">
        <fieldset>
            <legend><?php echo $this->groupForm->role_id->getLabel(); if($this->groupForm->role_id->isRequired() ){ ?>&nbsp;<span class="members-star star_class">*</span><?php } ?></legend>
            <div id="actionMessage">&nbsp;</div>
            
 
          <div class="clear btn-container">
            <span class="form-button ui-widget-content-1"><a href="Registration/104"><?php echo $this->translator->translator('register_regular_user'); ?></a></span>
 
            <span class="form-button ui-widget-content-1"><a href="Registration/107"><?php echo $this->translator->translator('register_agency'); ?></a></span>
        </div>
        </fieldset>
        
        
    </form>
	<div id="dialog_msg" title="<?php echo $this->translator->translator('common_dialog_msg',$this->translator->translator('Member_group_page_name')); ?>"></div>
</div>